<?php

use think\migration\Seeder;

class SystemPermissionSeed extends Seeder
{
  /**
   * Run Method.
   *
   * Write your database seeder using this method.
   *
   * More information on writing seeders is available here:
   * http://docs.phinx.org/en/latest/seeding.html
   */
  public function run()
  {
    \catcher\Utils::importTreeData($this->getPermissions(), 'permissions', 'parent_id');
  }

  protected function getPermissions()
  {
    return array(
      0 =>
      array(
        'id' => 37,
        'permission_name' => '系统管理',
        'parent_id' => 0,
        'level' => '',
        'route' => '/system',
        'icon' => 'bar-chart',
        'module' => 'system',
        'creator_id' => 1,
        'method' => 'get',
        'permission_mark' => 'system',
        'component' => 'pageView',
        'redirect' => '',
        'hide_children_in_menu' => 2,
        'keepalive' => 2,
        'type' => 1,
        'status' => 1,
        'sort' => 1,
        'created_at' => 1587462349,
        'updated_at' => 1593044431,
        'deleted_at' => 0,
        'children' =>
        array(
          0 =>
          array(
            'id' => 38,
            'permission_name' => '数据字典',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/system/database',
            'icon' => 'hdd',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'dataDictionary@index',
            'component' => 'database',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 8,
            'created_at' => 1587463087,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
            'children' =>
            array(
              0 =>
              array(
                'id' => 39,
                'permission_name' => '查看',
                'parent_id' => 38,
                'level' => '37-38',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'dataDictionary@view',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587463113,
                'updated_at' => 1591343449,
                'deleted_at' => 0,
              ),
              1 =>
              array(
                'id' => 40,
                'permission_name' => '列表',
                'parent_id' => 38,
                'level' => '37-38',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'dataDictionary@tables',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 10,
                'created_at' => 1587463173,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              2 =>
              array(
                'id' => 41,
                'permission_name' => '优化',
                'parent_id' => 38,
                'level' => '37-38',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'dataDictionary@optimize',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587463201,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              3 =>
              array(
                'id' => 42,
                'permission_name' => '备份',
                'parent_id' => 38,
                'level' => '37-38',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'optimize@backup',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587463217,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
            ),
          ),
          1 =>
          array(
            'id' => 43,
            'permission_name' => '附件管理',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/attactments',
            'icon' => 'folder-open',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'attactments',
            'component' => 'attachment',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 10,
            'created_at' => 1587463302,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
            'children' =>
            array(
              0 =>
              array(
                'id' => 44,
                'permission_name' => '列表',
                'parent_id' => 43,
                'level' => '37-43',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'attachments@index',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587463335,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              1 =>
              array(
                'id' => 45,
                'permission_name' => '删除',
                'parent_id' => 43,
                'level' => '37-43',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'attachments@delete',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587463355,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              2 =>
              array(
                'id' => 46,
                'permission_name' => '上传图片',
                'parent_id' => 43,
                'level' => '37-43',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'upload@image',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587466919,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              3 =>
              array(
                'id' => 47,
                'permission_name' => '上传文件',
                'parent_id' => 43,
                'level' => '37-43',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'upload@file',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587466939,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
            ),
          ),
          2 =>
          array(
            'id' => 48,
            'permission_name' => '配置管理',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/system/config',
            'icon' => 'setting',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'config',
            'component' => 'config',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 9,
            'created_at' => 1587466991,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
            'children' =>
            array(
              0 =>
              array(
                'id' => 49,
                'permission_name' => '父级配置',
                'parent_id' => 48,
                'level' => '37-48',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'config@parent',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467036,
                'updated_at' => 1591345651,
                'deleted_at' => 0,
              ),
              1 =>
              array(
                'id' => 50,
                'permission_name' => '存储',
                'parent_id' => 48,
                'level' => '37-48',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'config@save',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467052,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              2 =>
              array(
                'id' => 51,
                'permission_name' => '获取',
                'parent_id' => 48,
                'level' => '37-48',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'config@read',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467062,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
            ),
          ),
          3 =>
          array(
            'id' => 52,
            'permission_name' => '登陆日志',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/system/log/login',
            'icon' => 'export',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'loginLog',
            'component' => 'loginLog',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 5,
            'created_at' => 1587467150,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
            'children' =>
            array(
              0 =>
              array(
                'id' => 53,
                'permission_name' => '列表',
                'parent_id' => 52,
                'level' => '37-52',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'loginlog@list',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467206,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              1 =>
              array(
                'id' => 54,
                'permission_name' => '清空',
                'parent_id' => 52,
                'level' => '37-52',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'loginlog@empty',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467221,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
            ),
          ),
          4 =>
          array(
            'id' => 55,
            'permission_name' => '操作日志',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/system/log/operate',
            'icon' => 'profile',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'operateLog',
            'component' => 'operateLog',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 1,
            'created_at' => 1587467180,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
            'children' =>
            array(
              0 =>
              array(
                'id' => 56,
                'permission_name' => '列表',
                'parent_id' => 55,
                'level' => '37-55',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'operatelog@list',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467246,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
              1 =>
              array(
                'id' => 57,
                'permission_name' => '清空',
                'parent_id' => 55,
                'level' => '37-55',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'operatelog@empty',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1587467266,
                'updated_at' => 1587547118,
                'deleted_at' => 0,
              ),
            ),
          ),
          5 =>
          array(
            'id' => 58,
            'permission_name' => '代码生成',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/generate',
            'icon' => 'scissor',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'generate',
            'component' => 'generate',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 1,
            'created_at' => 1587717452,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
            'children' =>
            array(
              0 =>
              array(
                'id' => 59,
                'permission_name' => '生成',
                'parent_id' => 58,
                'level' => '37-58',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'generate@save',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1588110923,
                'updated_at' => 1588110923,
                'deleted_at' => 0,
              ),
              1 =>
              array(
                'id' => 60,
                'permission_name' => '预览',
                'parent_id' => 58,
                'level' => '37-58',
                'route' => '',
                'icon' => '',
                'module' => 'system',
                'creator_id' => 1,
                'method' => 'get',
                'permission_mark' => 'generate@preview',
                'component' => '',
                'redirect' => '',
                'hide_children_in_menu' => 1,
                'keepalive' => 1,
                'type' => 2,
                'status' => 1,
                'sort' => 1,
                'created_at' => 1588110962,
                'updated_at' => 1588110962,
                'deleted_at' => 0,
              ),
            ),
          ),
          6 =>
          array(
            'id' => 68,
            'permission_name' => '敏感词库',
            'parent_id' => 37,
            'level' => '37',
            'route' => '/sensitive/word',
            'icon' => 'sliders',
            'module' => 'system',
            'creator_id' => 1,
            'method' => 'get',
            'permission_mark' => 'sensitiveWord',
            'component' => 'sensitiveWord',
            'redirect' => '',
            'hide_children_in_menu' => 2,
            'keepalive' => 1,
            'type' => 1,
            'status' => 1,
            'sort' => 1,
            'created_at' => 1592375865,
            'updated_at' => 1593044431,
            'deleted_at' => 0,
          ),
        ),
      ),
    );
  }
}
